package com.hbnu.exercise.File;

import java.io.File;

public class Demo02
{
    public static void main(String[] args)
    {
        String path = "E://test";
        File file = new File(path);
        PrintFile(file);
    }

    private static void PrintFile(File file)
    {
        if (file.exists())
        {
            if (file.isDirectory())
            {
                File[] files = file.listFiles();
                if (files != null)
                    for (File value : files)
                        PrintFile(value);
            }
            else
                System.out.println(file.getName());
        }
    }
}
